package user

import (
	"github.com/gin-gonic/gin"
	"log"
	"test.com/project-api/router"
)

type RouterUser struct {
}

// 初始化用户路由
func init() {
	log.Println("init user router")
	ru := &RouterUser{}
	router.Register(ru)
}

// Route a用户路由
func (*RouterUser) Route(r *gin.Engine) {
	// 初始化grpc的客户端连接
	InitRpcUserClient()
	h := New()
	r.POST("/project/login/getCaptcha", h.GetCaptcha) // 注册获取验证码
	r.POST("/project/login/register", h.Register)     // 用户注册
	r.POST("/project/login", h.Login)                 // 用户登录
}
